package com.itqf.service.impl;

import com.itqf.entity.TbItemDesc;
import com.itqf.mapper.TbItemDescMapper;
import com.itqf.service.TbItemDescService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Description:
 * @Company: 千锋互联
 * @Author: 李丽婷
 * @Date: 2021/1/18
 * @Time: 上午11:16
 */
@Service("tbItemDescServiceImpl")  //xml  配置  <bean class="xxxx.TbItemDescServiceImpl">
//使用注解配置事务  类前：当前类的所有方法都走事务
//方法前：只有该方法有事务
@Transactional(isolation = Isolation.DEFAULT,propagation = Propagation.REQUIRED,
        readOnly = false,rollbackFor = RuntimeException.class)
public class TbItemDescServiceImpl implements TbItemDescService {

    //依赖dao  mapper
    @Autowired //按照类型注入
    private TbItemDescMapper tbItemDescMapper;



    @Override
    public int insert(TbItemDesc tbItem) {
       int i =  tbItemDescMapper.insert(tbItem);
       int k = 10/0;
        return i;
    }


}
